﻿#pragma once
#include "stdafx.h"

class CResultOperation
{
public:
	void Append(const HTuple& hv_Result)
	{
		m_tLock.Lock();
		m_hv_Result.Append(hv_Result);
		m_tLock.Unlock();
	}
	BOOL Query(HTuple& hv_SendData)//查询是否该帧存在拼图，如果存在 行数为hv_Row
	{
		BOOL bRet = FALSE;
		int nLen = m_hv_Result.Length();
		if (0==nLen)
		{
			hv_SendData.Clear();
			return bRet;
		}
		
		m_tLock.Lock();
		
		hv_SendData = m_hv_Result[0];
		TupleRemove(m_hv_Result, 0, &m_hv_Result);
		bRet = TRUE;
		m_tLock.Unlock();

		return bRet;
	}

	void GetElementCount(int & nCount)
	{
		nCount = m_hv_Result.Length();
	}

private:
	HTuple m_hv_FrameSN;
	HTuple m_hv_Result;
	CCriticalSection m_tLock;
};
